package com.ingeniouscamel.springjbosstx.web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestHandler;

import com.ingeniouscamel.springjbosstx.service.MyTxService;

@Component("myServlet")
public class MyServlet implements HttpRequestHandler {
	@Autowired
	private MyTxService myTxService;

	@Override
	public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		PrintWriter pw = response.getWriter();
		pw.print(myTxService.MyTxMethod());
		pw.flush();
	}
}
